"""
URL configuration for Django_6 project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/5.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""

from django.contrib import admin  # 引入Django自带的后台管理模块
from django.urls import path, include  # 引入用于定义URL路径和包含其他URL配置的函数
from . import views  # 从当前目录导入views模块，用于处理视图逻辑

urlpatterns = [
    path("admin/", admin.site.urls),  # 配置admin后台路径，如 http://localhost:8000/admin/
    path("", views.go_to),  # 当访问网站根路径（如 http://localhost:8000/）时，调用go_to视图函数
    path("polls/", include("polls.urls")),  # 将以polls/开头的请求交给polls应用的urls.py处理
    path("blogs/", include("blogs.urls"))
]